{% extends "index.html" %}

{% block inline_navi %}
<a href="/">Home</a>&nbsp;>&nbsp;Registrieren
{% endblock %}

{% block content %}

<h1>Registrieren</h1>
<p>
    Hier kannst du dich für uni.lotterm.org registrieren.
</p>

<div id="detail_table">
    <h3>Anmeldeformular</h3>
    <form action="{% url usermanagement.views.registerview %}" enctype="multipart/form-data" method="post">
        {% csrf_token %}
        {{ form.non_field_errors }}
        <table>
            <tr>
                <th class="detail_table_head">Pflichtfelder</th>
            </tr>
            <!-- Password -->
            <tr>
                {% if form.password.errors %}
                <th class="form_error"><label for="id_password">Passwort erforderlich:</label></th>
                {% else %}
                <th><label for="id_password">Passwort:</label></th>
                {% endif %}
                <td>{{ form.password }}</td>
            </tr>
            <!-- Password repetition -->
            <tr>
                {% if form.password_repetition.errors %}
                <th class="form_error"><label for="id_password_repetition">Passwort richtig wiederholen</label></th>
                {% else %}
                <th><label for="id_password_repetition">Passwort (Wiederholung):</label></th>
                {% endif %}
                <td>{{ form.password_repetition }}</td>
            </tr>
            <!-- E-Mail -->
            <tr>
                {% if form.email.errors %}
                <th class="form_error"><label for="id_email">E-Mail erforderlich / nur eine Anmeldung pro Email / nur UNI-Adressen:</label></th>
                {% else %}
                <th><label for="id_email">E-Mail:</label></th>
                {% endif %}
                <td>{{ form.email }}</td>
            </tr>
            <!-- First Name -->
            <tr>
                {% if form.first_name.errors %}
                <th class="form_error"><label for="id_first_name">Vorname erforderlich:</label></th>
                {% else %}
                <th><label for="id_first_name">Vorname:</label></th>
                {% endif %}
                <td>{{ form.first_name }}</td>
            </tr>
            <!-- Last Name -->
            <tr>
                {% if form.last_name.errors %}
                <th class="form_error"><label for="id_last_name">Nachname erforderlich:</label></th>
                {% else %}
                <th><label for="id_last_name">Nachname:</label></th>
                {% endif %}
                <td>{{ form.last_name }}</td>
            </tr>
            <tr>
                <td colspan="2" align="center" style="padding-top: 10px;">
                    <input type="submit" value="Registrieren" />
                </td>
            </tr>
        </table>
    </form>
</div>

{% endblock %}
